<template>
  <div class="table list_mains">
    <div class="container">
      <div class="fromdata">
        <h4>详情</h4>
      </div>
      <div class="fromdata formInline-btn">
        <div class="fr">
          <el-button @click="$router.go(-1)">返回</el-button>
          <el-button type="primary" @click="submitForm()">保存</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Attendancedetail',
  data () {
    return {
      ruleForm: {
        ownersCommAddress: '',
        ownersCommAddtime: '',
        ownersCommDuty: '',
        ownersCommDutyIdcard: ''
      },
      rules: {
        ownersCommName: [{ required: true, message: '请输入', trigger: 'blur' }],
        ownersCommDutyIdcardType: [{ required: true, message: '请选择', trigger: 'change' }]
      },
      pushurl: ''
    }
  },
  mounted () {
    // this.getParentParams()
    // this.getDetail()
  },
  methods: {
    // 获取详情
    getDetail () {
      let params = {
        communityId: this.$route.query.id
      }
      this.siveApi.communityinfo({params: params}).then(res => {
        if (!res.data.error) {
          let listData = res.data.result
          console.log(listData)
        }
      })
    },
    getParentParams () {
      
    },
    // 保存
    submitForm () {
      this.$refs['ruleForm'].validate(valid => {
        if (valid) {
          this.isShowloading = true
          this.addBtnFlag = false
          let params = this.ruleForm
          this.siveApi.communityProperty(params).then(res => {
            if (!res.data.error) {
              this.$message.success('保存成功')
            } else {
              this.$message.error(res.data.message)
            }
            this.isShowloading = false
            this.addBtnFlag = true
          })
        }
      })
    },
    // 取消
    resetForm () {
      this.$router.push(this.pushurl)
    }
  }
}
</script>
<style scoped>
.list_img{border-radius: 10px;overflow: hidden;height: 250px;margin: 0 20px 20px;}
</style>
